]> permondes.de Git - Analog_Engine.git/blame - scripts/EP1 04.02 Starting a Rocket_b.LACE
Throwing a stone on earth, starting a rocket from earth
[Analog_Engine.git] / scripts / EP1 04.02 Starting a Rocket_b.LACE
CommitLineData
68fb174e
P
1# A rocket is started from the surface of the earth. Calculating the height as function of its mass and fuel consumption.
2# Approximation of acceleration with Taylor series
3# Equation of motion
4# r'' = (alpha / m0)*v0 + (alpha/m0)²*v0*t - gamma * ME / r²
5# alpha: fuel consumption, e.g. 2000t in 2,5 min = 13,333*10^3 kg/s
6# m0: initial mass of rocket, e.g. Saturn V: 2900 t = 2,9*10^6 kg
7# v0: the velocity of the exhaust of the rocket: 3,180*10^3 m/s
8# gamma: gravitational constant: 6,6743E-11 m³/(kg*s²)
9# ME: mass of earth: 5,97E+24 kg
10
11# include idivide
12include CompoundFunctions.LACE
13
14coefficient.1(+1) -> alpha/m0*v0
15coefficient.2(+1) -> (alpha/m0)^2*v0
16coefficient.3 -> scale
17coefficient.4(-1) -> -RE
18coefficient.5(+1) -> 10*gamma*ME
19
20# generate t-ramp
21iintegrate (-1) -> t
22
23# calculating altitude
24iintegrate (alpha/m0*v0, (alpha/m0)^2*v0*t, -gamma*ME/r^2) -> -v # input is a ### 3. Term fehlen noch ###
25cmultiply (scale, -v) -> -v.scaled
26iintegrate (-v) -> r
27 IC: -RE
28
29# calculating acceleration
30multiply (r,r) -> r^2
31idivide (10*gamma*ME, r^2) -> -10*gamma*ME/r^2
32
33cmultiply ((alpha/m0)^2*v0, t) -> (alpha/m0)^2*v0*t
34
35# inverting velocity for display
36invert (-v.scaled) -> v.scaled
37
38# subtracting the radius of earth in order to get altitude above ground for display
39isum (-RE, r) -> -z
40invert (-z) -> z
41
42output (t) -> out.x
43output (v) -> out.y
44output (z) -> out.z